import { axios } from '@/utils/request'

const api = {
  questionnaires: '/questionnaires'
}

export default api

// get page message status
export function getApprovals (params) {
  return axios({
    url: api.questionnaires,
    method: 'get',
    params: params
  })
}

// select by id
export function selectApproval (id) {
  return axios({
    url: `${api.questionnaires}/${id}/get`,
    method: 'get'
  })
}

// 作废
export function toVoidApproval (id) {
  return axios({
    url: `${api.questionnaires}/${id}/invalid`,
    method: 'delete'
  })
}

// 通过
export function toPass (id) {
  return axios({
    url: `${api.questionnaires}/${id}/pass`,
    method: 'get'
  })
}
